import request from '/@/utils/request';

import requestTypes from '../common';


// 列表
const getList = (params: object = {}) => {
	return request({
		url: '/sysConfig/page',
		method: 'get',
		params: params,
	});
};

// 获取字典类型下所有字典
const sysDictTypeDropDown = <T = any>(parameter: object = {}) => {
	return requestTypes<T>({
		url: '/sysDictType/dropDown',
		method: 'get',
		params: parameter,
	});
}


// 新增
const addHandle = (parameter: object = {}) => {
	return request({
		url: '/sysConfig/add',
		method: 'post',
		data: parameter,
	});
}
// 删除
const deleteHandle = (parameter: object = {}) => {
	return request({
		url: '/sysConfig/delete',
		method: 'post',
		data: parameter,
	});
}
// 删除
const editHandle = (parameter: object = {}) => {
	return request({
		url: '/sysConfig/edit',
		method: 'post',
		data: parameter,
	});
}

export default {
	getList,
    sysDictTypeDropDown,
	addHandle,
	deleteHandle,
	editHandle,
};
